<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript" charset="utf-8">
$(function(){
	$.extend($.fn.validatebox.defaults.rules, {
	     phoneOrMobile: {//验证手机或电话
			    	  validator: function (value) {
			    	     return /^(13|15|18)\d{9}$/i.test(value) || /^((\(\d{2,3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}(\-\d{1,4})?$/i.test(value);
			    	 },
			    	    message: '请填入手机或电话号码,如13688888888或020-8888888'
			    },
		chinese : {// 验证中文
                     validator : function(value) {
			    	     return /^[\u0391-\uFFE5]+$/i.test(value);
			    	  },
			    	    message : '请输入中文'
			    },
		logname: {// 验证用户名
			    	 validator: function (value) {
			    	     return /^[a-zA-Z][a-zA-Z0-9_]{2,12}$/i.test(value);
			    	  },
			    	    message: '用户名不合法（字母开头，允许3-13字节，允许字母数字下划线）'
	           },

	});
});
</script>
<div style="padding: 15px;overflow: hidden;">
	<form id="userForm" method="post">
	<input name="id" type="hidden" />
		<table class="tableForm">
			<tr>
				<th >登录名</th>
				<td><input name="logname" class="easyui-validatebox" data-options="required:true,validType:'logname'" style="width: 150px;margin:0px 0px 8px 0px;"/>
				</td>
			</tr>
			<tr>
				<th >姓名</th>
				<td><input name="name" class="easyui-validatebox" data-options="required:true,validType:'chinese'" style="width: 147px;margin:0px 0px 8px 0px;" />
				</td>
			</tr>
			<tr>
				<th >性别</th>
				<td><input name="gender" class="easyui-combobox"  data-options="panelHeight:'auto',required:true,editable:false,valueField: 'label',textField: 'value',data: [{label: '男',value: '男'},{label: '女',value: '女'}]" style="width: 147px;margin:0px 0px 8px 0px;"/>
				</td>
			</tr>
			<tr>
				<th>联系方式</th>
				<td><input name="telephone" class="easyui-validatebox" data-options="required:true,validType:'phoneOrMobile'" style="width: 147px;margin:8px 0px 8px 0px;" />
			</tr>
			<tr>
				<th>角色</th>
				<td><input name="roleid" class="easyui-combobox"  data-options="panelHeight:'auto',required:true,editable:false,valueField: 'id',textField: 'rolename',url:' ${pageContext.request.contextPath}/roleAction!getRoleList.action'" style="width: 150px;margin:0px 0px 8px 0px;"/>
				</td>
			</tr>
			<tr>
				<th>创建时间</th>
				<td><input name="createdatetime" class="easyui-datebox" data-options="required:true" style="width: 150px;margin:8px 0px 8px 0px;"/>
				</td>
			</tr>
		</table>
	</form>
</div>
